<?php
@header("Content-type:text/html;charset=GB2312");
defined('BASEPATH') OR exit('No direct script access allowed');

class Server extends CI_Controller
{
    function index(){
        $my = $this->load->database('default', TRUE);
        $ms = $this->load->database('sqlserver', TRUE);

        $size = 500;
        $page = isset($_GET['page']) ? $_GET['page'] : 1;
        $zongshu = $page * $size;

        $sql = "select top $size * from (select top $zongshu  * from NC_DownServer order by DownID asc) NC_DownServer order by DownID desc";
        $msq = $ms->query($sql)->result_array();
        $m = array();
        foreach($msq as $v){
            $k = array(
                'DownID'=> $v['DownID'],
                'ChannelID'=> $v['ChannelID'],
                'DownloadName'=> $v['DownloadName'],
                'DownloadPath'=> $v['DownloadPath'],
                'depth'=> $v['depth'],
                'rootid'=> $v['rootid'],
                'orders'=> $v['orders'],
                'parentid'=> $v['parentid'],
                'strparent'=> $v['strparent'],
                'child'=> $v['child'],
                'UserGroup'=> $v['UserGroup'],
                'DownCount'=> $v['DownCount'],
                'IsDisp'=> $v['IsDisp'],
                'IsLock'=> $v['IsLock'],
                'DownPoint'=> $v['DownPoint'],
                'IsOuter'=> $v['IsOuter'],
                'selfont'=> $v['selfont'],
                'AllDownHits'=> $v['AllDownHits'],
                'DayDownHits'=> $v['DayDownHits'],
                'HitsTime'=> $v['HitsTime'],
            );
            $m[] = $k;
        }
        var_dump("<pre>");
        var_dump($m);
    }
}